import requests
import config

class OrganizationAPI:
    # 组织架构列表
    def organizationList(self, token):
        return requests.get(url=f"{config.url1}/api/company/department", headers={"Authorization": token})
    # 添加
    def addDepartment(self,token,body_data):
        return requests.post(url=f"{config.url1}/api/company/department", headers={"Authorization": token},json=body_data)
    # 查询
    def inquiryDepartment(self,token,id):
        return requests.get(url=f"{config.url1}/api/company/department/{id}",headers={"Authorization":token})
    def modifyDepartment(self,token,id,updata_department):
        return requests.put(url=f"{config.url1}/api/company/department/{id}",headers={"Authorization":token},json=updata_department)
    def deleteDepartment(self,token,id):
        return requests.delete(url=f"{config.url1}/api/company/department/{id}",headers={"Authorization":token})